home *** CD-ROM | disk | FTP | other *** search
- <!--//--><script language="javascript">
- /*
- This file contains the DHTML Library used for the TKM (it is by no means comprehensive).
-
- File Dependencies:
- None
-
- Required Initialization Method:
- None
- */
-
- function DHTMLLIBRARY()
- {
- this.CreateElt = DL_CreateElt;
- this.DrawElt = DL_DrawElt;
- this.GetElt = DL_GetElt;
- this.SetEltZIndex = DL_SetEltZIndex;
- this.SetEltVisibility = DL_SetEltVisibility;
- }
-
- function DL_CreateElt(name, content, left, top, z, width, height, visibility, backgroundColor, backgroundImage)
- {
- var markup = "";
-
- if (document.layers)
- {
- if (visibility && (visibility!=''))
- {
- if (visibility=="hidden") visibility = "hide";
- else if (visibility=="visible") visibility = "show";
- }
- markup = '<LAYER ID="' + name + '" NAME="' + name + '"' +
- ((left)?' LEFT="' + left + '"':'') +
- ((top)?' TOP="' + top + '"':'') + ((width)?' WIDTH="' + width + '"':'') +
- ((height)?' HEIGHT="' + height + '"':'') +
- ((visibility && (visibility!='')) ? ' VISIBILITY="' + visibility + '"' : '') +
- ((z)?' Z-INDEX="' + z + '"':'') +
- ((backgroundColor)?' BGCOLOR="' + backgroundColor + '"':'') +
- ((backgroundImage)?' BACKGROUND="' + backgroundImage + '"':'') +
- '>' + ((content)?content:'') + '</LAYER>';
- }
- else if (document.all)
- {
- markup = '<DIV ID="' + name + '" NAME="' + name + '"' +
- ' STYLE="position:absolute;' +
- ' overflow:none;' +
- ((left)?' left:' + left + 'px;':'') +
- ((top)?' top:' + top + 'px;':'') +
- ((height)?' height:' + height + 'px;':'') +
- ((width)?' width:' + width + 'px;':'') +
- ((visibility && (visibility!='')) ? ' visibility:' + visibility + ';' : '') +
- ((z)?' z-index:' + z + ';':'') +
- ((backgroundColor)?' background-color:' + backgroundColor + ';':'') +
- ((backgroundImage)?' background-image:url(' + backgroundImage + ');':'') + '"' +
- '>' +((content)?content:'') + '</DIV>';
- }
- return markup;
- }
-
- function DL_DrawElt(name, content, left, top, z, width, height, visibility, backgroundColor, backgroundImage)
- {
- if (DL_DrawElt.arguments.length < 10) backgroundImage = false;
- if (DL_DrawElt.arguments.length < 9) backgroundColor = false;
- if (DL_DrawElt.arguments.length < 8) visibility = false;
- if (DL_DrawElt.arguments.length < 7) height = false;
- if (DL_DrawElt.arguments.length < 6) width = false;
- if (DL_DrawElt.arguments.length < 5) z = false;
- if (DL_DrawElt.arguments.length < 4) top = false;
- if (DL_DrawElt.arguments.length < 3) left = false;
- if (DL_DrawElt.arguments.length < 2) content = false;
- document.write(this.CreateElt(name, content, left, top, z, width, height, visibility, backgroundColor, backgroundImage));
- }
-
- function DL_GetElt()
- {
- if (document.layers)
- {
- var currentLayer = document.layers[DL_GetElt.arguments[0]];
- for (var i=1; i<DL_GetElt.arguments.length && currentLayer; i++)
- {
- currentLayer = currentLayer.document.layers[DL_GetElt.arguments[i]];
- }
- return currentLayer;
- }
- else if (document.all)
- {
- var elt = eval('document.all.' + DL_GetElt.arguments[DL_GetElt.arguments.length-1]);
- return elt;
- }
- }
-
- function DL_SetEltZIndex(elt, z)
- {
- if (document.layers) elt.zIndex = z;
- else if (document.all) elt.style.zIndex = z;
- }
-
- // value must be either true or false
- function DL_SetEltVisibility(elt, value)
- {
- if (document.layers)
- {
- if (value) elt.visibility = 'show';
- else elt.visibility = 'hide';
- }
- else if (document.all)
- {
- if (value) elt.style.visibility = 'visible';
- else elt.style.visibility = 'hidden';
- }
- }
-
- var dl = new DHTMLLIBRARY();
- //--></script>